<?php

/**
 * Radcodes - SocialEngine Module
 *
 * @category   Application_Extensions
 * @package    Gmap
 * @copyright  Copyright (c) 2009-2010 Radcodes LLC (http://www.radcodes.com)
 * @license    http://www.radcodes.com/license/
 * @version    $Id$
 * @author     Vincent Van <vincent@radcodes.com>
 */
 
 
class Gmap_View_Helper_GmapMarker extends Zend_View_Helper_Abstract
{

	/*
	 * @param Radcodes_Lib_Google_Map $google_map
	 * @param Gmap_Model_Gmap $gmap
	 * @param array $options
	 */
	public function gmapMarker(Radcodes_Lib_Google_Map $google_map, Gmap_Model_Gmap $gmap, $options=array())
	{
		
    $infowindow_content = $this->view->partial('_map_infoWindow.tpl', 'gmap', array('gmap'=>$gmap));
    
    $infowindow = $gmap->getMapInfoWindow();
    $infowindow->setContent($infowindow_content);
    
    $marker = $gmap->getMapMarker();
      
    $marker->addHtmlInfoWindow($infowindow);
      
    $google_map->addMarker($marker);

    $after_init_js = $google_map->getOpenMarkerInfoWindowEventJs($marker, $infowindow);
    $google_map->addAfterInitJs($after_init_js);
    
    
    
    $return = $this->view->gmap($google_map, $options);
    
    return $return;
	}
	
	
	
}
